package leetcode.editor.week.week313;

// 6192. 公因子的数目
// https://leetcode.cn/problems/number-of-common-factors/
public class Solution6192 {
    public int commonFactors(int a, int b) {
        int count = 1;
        int max = Math.max(a, b);
        for (int i = 2; i <= max; i++) {
            if (((a / i) * i) == a && ((b / i) * i) == b) count++;
        }

        return count;
    }
}
